pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    // let fibonacci = 
    //     std::iter::successors(Some((0, 1)), |&(a, b)| Some((b, a + b)))
    //     .map(|pair| pair.0);
    // 
    // fibonacci
    //     .take_while(|&x| x < threshold)
    //     .filter(|x| x % 2 != 0)
    //     .sum()
    
    let (mut previous, mut current) = (0, 1);
    let mut sum = 0;
    
    while current < threshold {
        if current % 2 != 0 {
            sum += current;
        }
        let next = previous + current;
        previous = current;
        current = next;
    }
    
    sum
}
